var live800Url = 'https://chat10.live800.com/live800/chatClient/chatbox.jsp?companyID=958563&configID=234544&jid=5421142787&s=1';
var window_flag = 0;
var chat_window_zIndex;
// 开窗 --在线客服使用
function live800Dialog() {
	if (window_flag == 0) {
		layer.open({
			id : 'visitor_chat_window',
			type : 2,
			title : [ '在线咨询', 'font-size:16px;font-weight:bold;' ],
			area : [ '900px', '600px' ],
			maxmin : true,
			content : [ live800Url, 'no' ],
			shade : 0,
			anim : 4, // 0 默认 、1V字渐入、 2从底部向上、3回字渐入、4翻页、5淡入、6抖动
			zIndex : layer.zIndex, // 重点1
			success : function(layero, index) {
				window_flag = 1;
				$('#visitor_chat_window').parent('div.layui-layer')
						.css('min-width', '900px');
				var zIndex = $('#visitor_chat_window').parent(
						'div.layui-layer').css('zIndex');
				chat_window_zIndex = parseInt(zIndex);
			},
			cancel : function(index, layero) {
				closeWindow();
			},
			min : function(layero) {
				$('#visitor_chat_window').parent('div.layui-layer')
						.css('min-width', '');
			},
			restore : function(layero) {
				$('#visitor_chat_window').parent('div.layui-layer')
						.css('min-width', '900px');
			},
			full : function(layero) {
				$('#visitor_chat_window').parent('div.layui-layer')
						.css('min-width', '900px');
			}
		});
	} else {
		layer.alert('您已打开会话窗口', {
			icon : 0,
			zIndex : layer.zIndex + chat_window_zIndex
		});
	}
}

function openWinLive800(){
    window.open("https://chat10.live800.com/live800/chatClient/chatbox.jsp?companyID=958563&configID=234544&jid=5421142787&s=1","_blank",
        "width=560,height=454,resizable='no',scrollbars='no',top=100,left=200");
}
	

function closeWindow() {
	window_flag = 0;
	layer.closeAll();
}
//新消息提醒
var newtip='<div class="ordtip">'+
				'<div class="ordtipcon">'+
					'<a href="https://im.7881.com/" target="_blank" class="tourl"></a>'+
					'<a href="javascript:void(0)" class="closea" onclick="closeTip(this)"></a>'+
				'</div>'+
			'</div>';

function closeTip(obj){
	$(obj).parent().hide();
}

function fadeShow(){
	var wintopfir=$(".ordtip").height(); 
	var wintopsec=wintopfir-48; 
	$(".ordtipcon").css({top:wintopfir+"px"}); 
	$(".ordtipcon").animate({top:wintopsec+"px" }, 1000); 
}

$(document).on("mouseenter",".ordtipcon",function(){
	$(".ordtipcon").animate({top:"-5px" }, 200); 
})
$(document).on("mouseleave",".ordtipcon",function(){
	$(".ordtipcon").animate({top:"0px" }, 200); 
})

function addTips(){
	$('body').append(newtip);
	fadeShow();
}
